<!DOCTYPE html>
<html lang="zh-CN" style="background: #fff;">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>登录/注册</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <script src="js/rem.js"></script>
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="css/base.css" />
    <link rel="stylesheet" type="text/css" href="css/page.css" />
    <link rel="stylesheet" type="text/css" href="css/all.css" />
    <link rel="stylesheet" type="text/css" href="css/mui.min.css" />
    <link rel="stylesheet" type="text/css" href="css/loaders.min.css" />
    <!-- <link rel="stylesheet" type="text/css" href="css/loading.css"/> -->
    <link rel="stylesheet" type="text/css" href="slick/slick.css" />
    <link rel="stylesheet" type="text/css" href="iconfont/iconfont.css" />

</head>

<body style="background: #ffff;">
    <!--header star-->
    <header class="mui-bar mui-bar1 mui-bar-nav mui-bar-nav1" id="header" style="background: transparent;">
        <!-- <a class="back-btn" href="javascript:history.go(-1)">
		        <i class="iconfont icon-fanhui"></i>
		    </a> -->
        <!-- <div class="mui-title" style="color: #fff;">登录</div> -->
    </header>
    <!--header end-->

    <div class="warp clearfloat" style="margin: 0;">
        <div class="login-top clearfloat box-s">
            <div class="ge-back"><img src="img/login.png"></div>
            <div class="logo-imgs">
                <img src="img/touxiang.png">
            </div>
        </div>
    </div>
    <div class="tab-account" style="background: #fff;padding: 0;margin-top: 11%;" id="app">

        <div id="myTabContent" class="tab-content" style="background: #fff; padding: 0.4rem;">

            <div class="tab-pane fade in active" id="mima">
                <form role="form">
                    <div class="form-group login-group_re">
                        <i class="iconfont icon-shoujihaoma"></i>
                        <input type="text" class="form-control inpt-form" id="name" placeholder="请输入账号" v-model="userName">
                    </div>

                    <!-- <div class="form-group login-group_re">
                    <i class="iconfont icon-mima"></i>
                    <input data-toggle="password" data-placement="before" data-message="点击显示/隐藏密码" class="form-control inpt-form" type="password" placeholder="请输入密码" v-model="Pwd">
            </div> -->
                    <div class="yi-zhang wang-mi login-wang">
                        <div class="form-actions form-ji">
                            <div>

                            </div>
                        </div>
                        <!-- <a href="findWord.html">忘记密码？</a> -->
                    </div>

                    <button type="button" class="conf-btn login-btns" v-on:click="userLogin()">登录</button>

                </form>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <!-- 密码显示隐藏 -->
    <script src="js/bootstrap-show-password.js"></script>

    <script type="text/javascript" src="js/mui.min.js"></script>
    <script type="text/javascript" src="js/hmt.js"></script>
    <script type="text/javascript" src="slick/slick.js"></script>
    <script type="text/javascript" src="js/swiper.min.js"></script>
</body>





<!-- import Vue.js -->
<script src="js/vue/vue.js"></script>
<!-- import stylesheet -->
<link rel="stylesheet" href="js/iview/iview.css" />
<!-- <link rel="stylesheet" type="text/css" href="http://unpkg.com/view-design/dist/styles/iview.css"> -->
<!-- import iView -->
<script src="js/iview/iview.min.js"></script>

<script src="js/jsCookie/js.cookie.min.js"></script>

<script src="js/axios/axios.min.js"></script>

<script>
    var app = new Vue({
        el: "#app",
        data: {
            message: "Hello Vue!",
            widthData: 324,
            userName: "",
            Pwd: "",
            t: '',
        },
        methods: {
            userLogin() {
                let formData = new FormData();
                formData.append("randow", Math.random());
                formData.append("loginName", this.userName);
                // formData.append("Password", this.Pwd);
                let config = {
                    headers: {
                        "Content-Type": "multipart/form-data",
                    },
                };
                //shixunmis.zjtongji.edu.cn
                axios
                    .post(
                        "http://10.11.41.128:30010/noFilter/moveLogin?ticket=" + Cookies.get('ticket'),
                        formData,
                        config
                    )
                    .then((res) => {

                        if (res.data === null || res.data === "") return;
                        if (res.data.data) {
                            this.$Message.success("登录成功");
                            Cookies.set("userInfo", res.data.data, {
                                expires: 7,
                            });
                            window.location.href = "index.html";
                        } else {
                            this.$Message.error("登录失败" + res.data.msg);
                        }
                    });
            },
            f(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                var r = window.location.search.substr(1).match(reg);
                if (r != null)
                    return (r[2]);
                return null;
            },

        },
        mounted: function() {
            this.t = this.f('ticket');
            Cookies.set("ticket", this.t);
            //window.ticket = this.f('ticket');
            if (this.t === null) {
                //window.location.href = 'https://newca.zjtongji.edu.cn/cas/login?service=http://10.11.41.128:30010/m/login.html'
            }
            
            //alert(Cookies.get('ticket'));
            // this.t = this.f('ticket')
            // if (this.t === null) {
            //     window.location.href = 'https://newca.zjtongji.edu.cn/cas/login?service=http://10.11.41.128:30010/m/#/login'
            // }
            
        },
    });
</script>


</html>